<div class="page plantilla-pe" data-ng-controller="PlantillaPECtrl">

    <div class="row ui-section">
        <div class="col-lg-8 clearfix">
            <h2 class="section-header"data-translate="PAGE_PE_TITLE"></h2>
        </div>
    </div>
    <div class="panel panel-default">
        <div class="panel-body pe-builder">
            <div class="row">
                <div class="col-xs-4">
                    <div class="form-group row">
                        <label class="col-xs-4 control-label" for="intensity" data-translate="PAGE_PE_LABEL_INTENSITY"></label>  
                        <div class="col-xs-8">
                            <input id="intensity" name="intensity" type="number" placeholder="{{'PAGE_PE_LABEL_INTENSITY' | translate}}" class="form-control input-md" required=""
                            ng-model="objetivo.Intenciada"
                            min="{{objetivo.IntenciadaMin}}"
                            max="{{objetivo.IntenciadaMax}}"
                            step="0.1">
                            <span class="help-block" ng-if="objetivo">Min: {{objetivo.IntenciadaMin}} / Max: {{objetivo.IntenciadaMax}}</span>
                        </div>
                    </div>
                </div>
                <div class="col-xs-8 text-right">
                    <div class="form-group">
                        <md-button
                            ng-click="openToolBox($event)"
                            data-translate="PAGE_PE_CTA_TOOL_BOX"
                            aria-label="{{'PAGE_PE_CTA_TOOL_BOX' | translate}}"></md-button>
                    </div>
                </div>
                <div class="col-xs-12">
                    <div class="ui-tab-container ui-tab-vertical">
                        <tabset class="ui-tab">
                            <tab data-ng-repeat="i in numeroDeSemanas track by $index" ng-init="numSemana=($index+1)" heading="{{('PAGE_PE_TH_WEEK_'+numSemana) | translate}}">
                                <div style="min-height: 401px;">
                                    <table class="table table-stripped">
                                        <thead>
                                            <tr>
                                                <th data-translate="PAGE_PE_TH_EXERCISE"></th>
                                                <th data-translate="PAGE_PE_TH_SERIES"></th>
                                                <th data-translate="PAGE_PE_TH_REPETITIONS"></th>
                                                <th data-translate="PAGE_PE_TH_RMT"></th>
                                                <th data-translate="PAGE_PE_TH_WEIGHT"></th>
                                                <th data-translate="GENERIC_LIST_TABLE_TH_ACTIONS"></th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr data-ng-repeat="ejercicio in planEntrnmento.ejercicios">
                                                <td>{{ejercicio.Nombre}}</td>
                                                <td>
                                                    <input type="number" required=""
                                                        class="form-control input-sm"
                                                        data-ng-model="ejercicio.semanas[$parent.$index].Series"
                                                        min="{{objetivo.SeriesMin}}"
                                                        max="{{objetivo.SeriesMax}}"
                                                        ng-change="updateWeekSeries($index, $parent.$index, ejercicio.semanas[$parent.$index].Series)">
                                                </td>
                                                <td>
                                                    <input type="number" required=""
                                                        class="form-control input-sm"
                                                        data-ng-model="ejercicio.semanas[$parent.$index].Repeticiones"
                                                        min="{{objetivo.RepeticionesMin}}"
                                                        max="{{objetivo.RepetionesMax}}">
                                                </td>
                                                <td>
                                                    <input type="number" required=""
                                                        class="form-control input-sm"
                                                        data-ng-model="ejercicio.RMT"
                                                        min="0">
                                                </td>
                                                <td>
                                                    <input type="number" required=""
                                                        class="form-control input-sm"
                                                        data-ng-model="ejercicio.semanas[$parent.$index].Peso"
                                                        min="0">
                                                </td>
                                                <td class="text-right">
                                                    <md-button data-ng-click="deleteExercise($event, $index)" aria-label="{{'GENERIC_FORM_CTA_DELETE' | translate}}" class="md-icon-button" title="{{'GENERIC_FORM_CTA_DELETE' | translate}}"><span class="imd imd-delete"></span></md-button>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </tab>
                        </tabset>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>